#import "dfhgwhruebvhrheyoutwarddelegate.h"
#import "dfhgwhruebvhrheyluggagerecorder.h"
#import "dfhgwhruebvhrheycountermanner.h"
@interface dfhgwhruebvhrheycountermanner ()
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UILabel *tipsText;
@property (weak, nonatomic) IBOutlet UITextField *codeInput;
@property (weak, nonatomic) IBOutlet UITextField *phoneInput;
@end
@implementation dfhgwhruebvhrheycountermanner {
	int cut_down;
	CAGradientLayer *gradientLayer;
	void(^_click)(UIButton *sender, NSString *code);
}
- (void)awakeFromNib {
	[super awakeFromNib];
	self.bgView.layer.cornerRadius = 10;
	self.bgView.layer.masksToBounds = YES;
	gradientLayer = [CAGradientLayer layer];
	gradientLayer.startPoint = CGPointMake(0, 0);
	gradientLayer.endPoint = CGPointMake(0, 1);
	gradientLayer.colors = @[(__bridge  id)@"#EFECFF".dhgfywegwygeydwlearneddesignate.CGColor, (__bridge  id)[UIColor whiteColor].CGColor];
	gradientLayer.locations = @[@(0.3), @(1.0)];
	[self.bgView.layer insertSublayer:gradientLayer atIndex:0];
	self.phoneInput.enabled = NO;
	self.phoneInput.text = [self handlePhoneNumber];
	self.tipsText.text = [NSString stringWithFormat:@"We have sent a verification code to %@. Please check and enter the verification code", [self handlePhoneNumber]];
}
- (NSString *)handlePhoneNumber {
	NSString *mobie = [[dfhgwhruebvhrheyoptionsaving getUserData].phone mutableCopy];
	if (![mobie hasPrefix:@"0"]) {
		mobie = [NSString stringWithFormat:@"0%@",mobie];
	}
	return [mobie stringByReplacingCharactersInRange:NSMakeRange(4, 4) withString:@"****"];
}
- (void)sureViewBtnsClick:(void(^)(UIButton *sender, NSString *code))click {
	_click = click;
}
- (IBAction)btnsClick:(UIButton *)sender {
	if (_click) {
		if (sender.tag == 101) {
			if (self.codeInput.text.length != 6) {
				return [dfhgwhruebvhrheyoptionsaving.keyWindow show:@"Please enter the correct code"];
			}
		}
		_click(sender, self.codeInput.text);
	}
}
- (void)layoutSubviews {
	[super layoutSubviews];
	gradientLayer.frame = self.bgView.bounds;
}
@end
